package com.bix.util.blizfiles.m2;

import java.nio.ByteBuffer;

public class M2Light {
	//
	// Light Types:
	//
	//	0	 Directional
	//	1	 Point light
	//
	private	short	type;
	
	//
	// If attached to a bone, this is the bone, otherwise, it's -1
	//
	private	short	bone;
	
	//
	// Where the light is located.
	//
	private	float[]	position = new float[3];
	
	//
	// Ambient color and intensity.
	//
	private	M2RGB	ambientColor;
	private	float	ambientIntensity;
	
	//
	// Diffuse color and intensity.
	//
	private	M2RGB	diffuseColor;
	private	float	diffuseIntensity;
	
	//
	// Attenuation start and end.
	//
	private	float	attenuationStart;
	private	float	attenuationEnd;
	
	//
	// Usually 1?
	//
	private	int		unknown;
	
	public M2Light () {
	}
	
	public M2Light (ByteBuffer bb) {
		read (bb);
	}
	
	public void read (ByteBuffer bb) {
		bb.position (bb.position () + 0x9A);
	}

	/**
	 * @return the type
	 */
	public short getType() {
		return type;
	}

	/**
	 * @return the bone
	 */
	public short getBone() {
		return bone;
	}

	/**
	 * @return the position
	 */
	public float[] getPosition() {
		return position;
	}

	/**
	 * @return the ambientColor
	 */
	public M2RGB getAmbientColor() {
		return ambientColor;
	}

	/**
	 * @return the ambientIntensity
	 */
	public float getAmbientIntensity() {
		return ambientIntensity;
	}

	/**
	 * @return the diffuseColor
	 */
	public M2RGB getDiffuseColor() {
		return diffuseColor;
	}

	/**
	 * @return the diffuseIntensity
	 */
	public float getDiffuseIntensity() {
		return diffuseIntensity;
	}

	/**
	 * @return the attenuationStart
	 */
	public float getAttenuationStart() {
		return attenuationStart;
	}

	/**
	 * @return the attenuationEnd
	 */
	public float getAttenuationEnd() {
		return attenuationEnd;
	}

	/**
	 * @return the unknown
	 */
	public int getUnknown() {
		return unknown;
	}
}
